//
//  TestView.m
//  Objc进阶Demo
//
//  Created by Don't update on 2018/7/17.
//  Copyright © 2018年 Don't update. All rights reserved.
//

#import "TestView.h"




@implementation TestView

-(void)layoutSubviews{
    self.backgroundColor = [UIColor lightGrayColor];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn setTitle:@"跳转" forState:UIControlStateNormal];
    btn.frame = CGRectMake(100, 200, 60, 30);
    [btn addTarget:self action:@selector(changeView) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:btn];
}


-(void)changeView{
    if ([self.delegate respondsToSelector:@selector(goToController)]) {
        [self.delegate goToController];
    }
}


@end
